package com.albaba.designpattern.chain_of_responsibility.text_003;

import com.albaba.designpattern.chain_of_responsibility.text_002.AuthInfo;
import org.slf4j.LoggerFactory;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Logger;

/**
 * @author zx
 * @version 1.0
 * @description 抽象审核链类
 * @date 2025/2/24 22:46
 */

public abstract class AuthLink {

    protected SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    // 当前审核人id
    protected String levelUserId;

    // 当前审核人姓名
    protected String levelUserName;

    // 持有下一个对象的引用
    protected AuthLink next;

    public AuthLink(String levelUserId, String levelUserName) {
        this.levelUserId = levelUserId;
        this.levelUserName = levelUserName;
    }

    // 获取下一个对象
    public AuthLink getNext() {
        return next;
    }

    // 向责任链中添加下一个对象
    public AuthLink appendNext(AuthLink next) {
        this.next = next;
        return this;
    }

    // 抽象方法，具体实现由子类实现
    public abstract AuthInfo doAuth(String uId, String orderId, Date authDate);
}
